#!/usr/bin/env python3

import xarray as xr
import numpy as np

time_str = '2000-01-02'

f1 = xr.open_dataset('tc.360x180x30.h0.nc').sel(time=time_str)
f2 = xr.open_dataset('tc.restart.360x180x30.h0.nc').sel(time=time_str)

diff = f1.phs - f2.phs
print('phs:', float(np.min(diff)), float(np.max(diff)))

diff = f1.pt - f2.pt
print('pt:', float(np.min(diff)), float(np.max(diff)))

diff = f1.u - f2.u
print('u:', float(np.min(diff)), float(np.max(diff)))

diff = f1.v - f2.v
print('v:', float(np.min(diff)), float(np.max(diff)))

diff = f1.div - f2.div
print('div:', float(np.min(diff)), float(np.max(diff)))

diff = f1.vor - f2.vor
print('vor:', float(np.min(diff)), float(np.max(diff)))
